package com.test.rabbitmq.controller;

import com.test.rabbitmq.manager.RabbitMQManager;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName SendMsgController
 * @Author lulei
 * @Data 2020/3/12 22:15
 */

@RestController
public class SendMsgController {

    @Resource
    RabbitMQManager rabbitMQManager;

    @RequestMapping("sendMsg")
    public Object sendMsg () {

        rabbitMQManager.sendMsg();
        return "发送成功！";
    }

    @RequestMapping("sendMsgByExc")
    public Object sendMsgByExc () {

        rabbitMQManager.sendMsgByExchange();

        return "发送发布订阅模型的对列发送成功！";
    }
}
